package com.guoliang.cmsService.controller;

import com.guoliang.cmsService.entity.CrmBanner;
import com.guoliang.cmsService.service.CrmBannerService;
import com.guoliang.commonUtils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author leo
 * @since 2023-01-25
 */
@RestController
@RequestMapping("/cmsService/crmBanner")
public class CrmBannerController {
   @Autowired
    CrmBannerService bannerService;
   @GetMapping("getAll")
    public CommonResult getAllBanner(){
       List<CrmBanner> bannerList=bannerService.seleteAllBanner();
       return CommonResult.ok().data("banners",bannerList);
   }
}
